package Lianxi.ATM;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 查询功能
 */
public class Check extends JPanel implements ActionListener {
    private JButton returnBut;//返回按钮
    private Atm frame;
    private JLabel label;
    private JLabel label1;



    public Check(Atm frame) {


        this.frame = frame;
        //空布局
        this.setLayout(null);
        //设置透明
        this.setOpaque(false);

        //返回按钮,返回菜单界面
        returnBut = new JButton("返回");
        returnBut.setBounds(280, 600, 100, 50);
        this.add(returnBut);
        returnBut.addActionListener(this);

        label = new JLabel("用户名");
        label.setBounds(280, 220, 120, 50);
        this.add(label);

        label1 = new JLabel("金额");
        label1.setBounds(280, 270, 120, 50);
        this.add(label1);


    }
    public JLabel getLabel() {
        return label;
    }

    public void setLabel(JLabel label) {
        this.label = label;
    }

    public JLabel getLabel1() {
        return label1;
    }

    public void setLabel1(JLabel label1) {
        this.label1 = label1;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == returnBut) {
            frame.switchPanel("菜单");
        }
    }
}
